<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" type="text/css"	href="css/rest.css" />
<link rel="stylesheet" type="text/css"	href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"	href="css/shouye.css" />
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/index.js"></script>
<script src="js/jquery.form.js"></script>
<script src="js/layer/layer.js"></script>
<script src="js/dist/echarts.js"></script>

<style>
   .file {
	    position: relative;
	    display: inline-block;
	    border-radius: 4px;
	    padding: 4px 12px;
	    overflow: hidden;
	    color: #1E88C7;
	    text-decoration: none;
	    text-indent: 0;
	    line-height: 20px;
	    width: 100%;
	    cursor: pointer;
	    margin-bottom: 0;
	}
	/* body a {
		text-decoration: none!important;
	} */
</style>
<script type="text/javascript">
	function uploadPic() {  
	    // 上传设置  
	    var options = {  
	            url: "{:U('uploadImg')}",  
	            type: "post",  
	            dataType: "json",  
	            success: function(data, status, xhr) {  
	                var time = new Date();
	                $("#headImg").attr("src", data.imgUrl+'?time='+time.getTime());  
	            }  
	    };  
	    $("#headImgform").ajaxSubmit(options);  
	}  
</script>
</head>
<body>
<div>
	<div class="container-fluid">
		<div class="row">
			<div class=" col-md-6">
				<div class="main-left">
					<div class="clearfix" style="float: left;">
						<dl class="toux fl">
							<dt style="padding: 4px ;">
								<img id="headImg" src="{$shop['headImg']}" style="width: 100px; height: 100px;"/>
							</dt>
							<label class="file" for="xFile">修改头像</label>
							<form id="headImgform" action="" method="post" enctype="multipart/form-data">
								<input type="file" name="pic" id="xFile" style="position:absolute;clip:rect(0 0 0 0);" onchange="uploadPic()">
							</form>
						</dl>
						<div class="fl con_a">
							<span class="span01" style="margin-bottom: 10px; display: block;">{$shop['username']}</span> 
							<p><img src="images/sj03.png" style="width: 18px; height: 18px;"/>&nbsp;商家</p>
							<div class="sj">
									<if condition="$shop[telIsAuth] neq 1">
										<a href="{:U('AuthCenter/renzhengzhongxin')}" class="img01">
										<img src="images/sj01_b.png" style="width: 30px; height: 30px;" />		
										</a> 				
									<else/>
										<a href="{:U('AuthCenter/chakan')}" class="img01">
										<img src="images/sj01.png" style="width: 30px; height: 30px;" />
										</a> 	
									</if>
									<if condition="$shop[shopIsAuth] neq 1">
										<a href="{:U('AuthCenter/renzhengzhongxin')}" class="img03">
												<img src="images/sj03_b.png"  style="width: 30px; height: 30px;"/>			
										</a> 							
									<else/>
										<a href="{:U('AuthCenter/chakan01')}" class="img03">
												<img src="images/sj03.png"  style="width: 30px; height: 30px;"/>
										</a> 
									</if>
								<div class="rz01">
									<if condition="$shop[telIsAuth] neq 1">
										手机未认证
									<else/>
										手机已认证 
									</if>
									<span class="span01"></span>
								</div>
								<div class="rz03" style="left: 25px;">
									<if condition="$shop[shopIsAuth] neq 1">
										商家未认证
									<else/>
										商家已认证 
									</if>
									<span class="span01"></span>
								</div>
							</div>
						</div>
					</div>
					<div class="clearfix" style="float: left;">
						<dl class="toux fl">
							<dt style="padding: 4px ;">
								<img id="headImg" src="{$shop['headImg']}" style="width: 100px; height: 100px;"/>
							</dt>
							<label class="file" for="xFile">商家logo</label>
							<form id="headImgform" action="" method="post" enctype="multipart/form-data">
								<input type="file" name="pic" id="xFile" style="position:absolute;clip:rect(0 0 0 0);" onchange="uploadPic()">
							</form>
						</dl>
						<div class="fl con_a">
							<p style="padding-top:40px;">商家名称：<span>大帅锅</span></p>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>

			</div>
			<!-- 右边部分-->
			<div class=" col-md-4">
				<div class="main-right">
					<div class="row">

						<div class=" col-md-3 col-sm-3">
							<a href="{:U('Shops/jibenziliao')}" class="aa"> 
								<span> 
									<i class="xx02"></i>
								</span> 
								<em>修改资料</em>
							</a>
						</div>


						<div class=" col-md-3 col-sm-3">
							<a href="{:U('Account/integralDetail')}" class="aa"> 
								<span> 
									<i class="xx06"></i>
								</span> 
								<em>积分明细</em>
							</a>
						</div>

						<div class="col-md-3 col-sm-3">
							<!-- <a href="{:U('Account/gufenzhongxin')}" class="aa"> -->
							<a href="javascript:layer.alert('正在维护。。。');" class="aa"> 
								<span> 
									<i class="xx04"></i>
								</span> 
								<em>股份中心</em>
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>

	<!--中间部分-->
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-6 ">
				<div class="main-left01 clearfix">
					<div class="top">账户统计</div>
					<div class="zong clearfix">
						<div class="zong_l pull-left">
							<a href="javascript:;" class="xian" style="cursor: default;">账户余额</a> <span>{$shop['cashTotal']}元</span>
							<a href="{:U('Account/tixian', array('type'=>1))}">提现>></a><!-- <a href="{:U('Account/chongzhi')}">账户充值>></a> --><a href="###" onclick="charge()">账户充值>></a>
						</div>

					</div>
					<div class="zong clearfix">
						<div class="zong_l pull-left">
							<a href="javascript:;" class="xian" style="cursor: default;">优惠金额</a> 
							<span>{$shop['principal']*100+$shop['givenBalance']*100}分</span><a href="###" onclick="charge()">优惠金额充值>></a>
						</div>
						<div class="zong_l pull-left">
							<a href="javascript:;" class="xian" style="cursor: default;">多宝</a> 
							<span>{$shop['duobaoPrincipal']*100+$shop['integralBalance']*100}个 </span> 
							<a href="{:U('Account/tixian', array('type'=>2))}">提现>></a>
						</div>
						<div class="zong_l pull-left">
							<a href="javascript:void(0);" onclick="checkAuth()" class="xian">积分分发</a> 
							<span style="margin-left: 52px;">{$shop['integral']*100}分 </span>
						</div>
					</div>
				</div>
			</div>



			<!--右侧-->
			<!-- 这一块做商家商城收益 -->
			<div class="col-md-6">
				<div class="main-right01">
					<div class="top">
						我的收益<a href="{:U('Account/earnings')}" class="duo">更多>></a>
					</div>
					<div id="main" style="height:400px">
					</div>
					</div>
					<!-- <table border="0" cellspacing="" cellpadding="" class="table04">
						<tr>
							<th>用户</th>
							<th>现金</th>
							<th>积分收益</th>
						</tr>
						<tr>
							<td>w13855734358</td>
							<td>0.00</td>
							<td>1,494,375.000</td>
						</tr>
						<tr>
							<td>zkxx15868</td>
							<td>0.00</td>
							<td>1,114,245.000</td>
						</tr>
					</table> -->
				</div>
			</div>

		</div>
	</div>
	<script>
		function checkAuth(){
			$.ajax({
				url: "{:U('Index/checkAuth')}",
				type: "post",
				data: null,
				dataType: 'json',
				success: function (res){
					if(res.status == 1){
						location.href="{:U('Account/inte')}";
					}else{
						layer.open({
							content:"商家未认证，认证后使用。",
							yes: function(){
								location.href="{:U('AuthCenter/renzhengzhongxin')}";
							}
						});
					}
				}
			});
		}
	</script>
	<script>
	// 路径配置
    require.config({
        paths: {
            echarts: 'js/dist'
        }
    });
    
    // 使用
    require(
        [
            'echarts',
            'echarts/chart/line',// 使用柱状图就加载bar模块，按需加载
            'echarts/chart/bar',
        ],
        function (ec) {
            // 基于准备好的dom，初始化echarts图表
            var myChart = ec.init(document.getElementById('main')); 
            
            var option = {
            	    tooltip : {
            	        trigger: 'axis'
            	    },
            	    legend: {
            	        data:['现金余额转换','优惠余额转换']
            	    },
            	    toolbox: {
            	        show : true,
            	        feature : {
            	            mark : {show: false},
            	            dataZoom : {show: true},
            	            dataView : {show: true},
            	            magicType : {show: true, type: ['line', 'bar']},
            	            restore : {show: true},
            	            saveAsImage : {show: true}
            	        }
            	    },
            	    calculable : true,
            	    dataZoom : {
            	        show : true,
            	        realtime : true,
            	        start : 20,
            	        end : 80
            	    },
            	    xAxis : [
            	        {
            	            type : 'category',
            	            boundaryGap : false,
            	            data : {$date}
            	        }
            	    ],
            	    yAxis : [
            	        {
            	            type : 'value'
            	        }
            	    ],
            	    series : [
            	        {
            	            name:'现金余额转换',
            	            type:'line',
            	            data:{$benjin}
            	        },
            	        {
            	            name:'优惠余额转换',
            	            type:'line',
            	            data:{$jifen}
            	        }
            	    ]
            	};
    
            // 为echarts对象加载数据 
            myChart.setOption(option); 
        }
    );
	
	
	
	
	
	</script>
	
	
	<script>
		function charge(){
			layer.open({
			    title:'提示',
			    content:'自助充值正在维护中，充值请直接转账支付宝账户18056186099，备注请填写平台用户名和充值类型（如账户余额充值）'
			});
		}
	</script>
</body>

</html>